<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Class绑定</title>
  <style>
    h1 .active {
      font-weight: 800;
    }
    h1 .text-danger {
      color: red;
    }
  </style>
</head>
<body>
  <div id="app">
    <!-- 对象语法: class 绑定 (可以多个class) -->
    <h1 :class="{active: isActive, 'text-danger': hasError}">
      abc
    </h1>
  </div>
  <script src="./js/vue.js"></script>
  <script>
    const app = new Vue({
      el: "#app",
      data: {
        isActive: true,
        hasError: false,
        imgSrc: "../02CSS基础/assets/a.png"
      },
    })
  </script>
</body>
</html>